#pragma once
#include <iostream>
#include <list>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <filesystem>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <cmath>

#include <vtkStripper.h>
#include <vtkSTLWriter.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/features/normal_3d.h>
#include <pcl/surface/gp3.h>   
#include<pcl/io/vtk_lib_io.h>
#include <vtkNew.h>

#include <pcl/pcl_macros.h>
#include <pcl/PCLPointCloud2.h>
#include <pcl/PolygonMesh.h>

#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>

#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>

#include<vtkRenderWindow.h>
#include<vtkSmartPointer.h>

#include <vtkSmartPointer.h>
#include <vtkPolyDataReader.h>
#include <vtkPolyData.h>
#include <vtkSurfaceReconstructionFilter.h>
#include <vtkContourFilter.h>
#include <vtkVertexGlyphFilter.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkRenderer.h>
#include <vtkCamera.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkProperty.h>
#include <vtkPolyDataNormals.h>
#include <vtkSphereSource.h>
#include <vtkPolyDataMapper.h>

#include <vtkRenderWindow.h>
#include <vtkGenericOpenGLRenderWindow.h>
#include <vtkNamedColors.h>
#include <vtkProperty.h>
#include <vtkSmartPointer.h>

#include <vtkRenderWindow.h>
#include <vtkPlanes.h>

#include <vtkProperty.h>

#include <vtkSmartPointer.h>
#include <vtkColorTransferFunction.h>
#include <vtkPiecewiseFunction.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkTransform.h>
#include <vtkTransformPolyDataFilter.h>
#include <vtkCubeSource.h>

#include <vtkAlgorithmOutput.h>
#include <vtkCleanPolyData.h>
#include <vtkTriangleFilter.h>

#include <vtkStripper.h>
#include <vtkSTLWriter.h>

#include <vtkNew.h>

#include <vtkStripper.h>
#include <vtkSTLWriter.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/features/normal_3d.h>
#include <pcl/surface/gp3.h>   
#include<pcl/io/vtk_lib_io.h>
#include <vtkNew.h>
#include <pcl/io/vtk_io.h>
#include <pcl/io/pcd_io.h>
#include<pcl/io/vtk_lib_io.h>

#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>

#include<vtkRenderWindow.h>
#include<vtkSmartPointer.h>

#include <vtkSmartPointer.h>
#include <vtkPolyDataReader.h>
#include <vtkPolyData.h>
#include <vtkSurfaceReconstructionFilter.h>
#include <vtkContourFilter.h>
#include <vtkVertexGlyphFilter.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkRenderer.h>
#include <vtkCamera.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkProperty.h>
#include <vtkPolyDataNormals.h>
#include <vtkSphereSource.h>
#include <vtkPolyDataMapper.h>

#include <vtkRenderWindow.h>
#include <vtkGenericOpenGLRenderWindow.h>
#include <vtkNamedColors.h>
#include <vtkProperty.h>
#include <vtkSmartPointer.h>

#include <vtkRenderWindow.h>
#include <vtkPlanes.h>

#include <vtkProperty.h>

#include <vtkSmartPointer.h>
#include <vtkColorTransferFunction.h>
#include <vtkPiecewiseFunction.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkTransform.h>
#include <vtkTransformPolyDataFilter.h>
#include <vtkCubeSource.h>

#include <vtkAlgorithmOutput.h>
#include <vtkCleanPolyData.h>
#include <vtkTriangleFilter.h>

#include <vtkStripper.h>
#include <vtkSTLWriter.h>

#include <vtkNew.h>

#include <vtkStripper.h>
#include <vtkSTLWriter.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/features/normal_3d.h>
#include <pcl/surface/gp3.h>   
#include<pcl/io/vtk_lib_io.h>
#include <vtkNew.h>
#include <pcl/io/vtk_io.h>

using namespace std;

class DataUtil
{
public:

	DataUtil() {}
	~DataUtil() {}

public:
	void loadData(const  string& file_name);

	void createPCDFile(const string& path, const string& filename, const string& output_path, int width);
	void splitData(const string& file_name);
	void splitData(const string& path, const string& filename);
	void splitPisson(const string& file_name);
	void splitYoungmod(const string& filename);
	//template <size_t N>
	//void splitString(string(&arr)[N], string str);
	void print_csv_double(const vector<double> line_data);
	void CreateCloudFromTxt(const std::string& file_path, pcl::PointCloud<pcl::PointXYZ>::Ptr cloud);

	void generateMesh(string filename);

};